home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LOGIC Apps
/
Logic-APPLE_II_APPS.iso
/
mac
/
LOGIC Apple II 5.25" Library - ProDOS
/
PRO004.dsk
/
FILECAB.STUFFER.bas
< prev
next >
Wrap
BASIC Source File
|
2012-02-16
|
7KB
|
177 lines
10 REM ORIGINAL 3.3 VERSION 1/07/80 BY MIKE KRAMER
13 REM PRODOS VERSION 6/17/84
15 REM BY MICHAEL MOORE
18 REM INPUT ANYTHING ROUTINE ADDED 6/17/84
20 REM *************************
30 REM * *
40 REM * FILE CABINET STUFFER *
50 REM * *
60 REM * WRITTEN BY *
70 REM * *
80 REM * MIKE KRAMER *
90 REM * *
100 REM * 10/10/80 *
110 REM * *
120 REM *************************
130 REM
140 D$ = CHR$(4)
150 PRINT D$"PREFIX"
155 INPUT PX$: REM OBTAIN PATH OF CURRENT DISK
160 MEM = FRE(0): IF MEM <0 THEN MEM = 65536 +MEM
170 RC = INT(MEM/110)
180 DIM FD$(30),IP$(RC,21),H$(21),IT(21),TI$(3)
185 GOSUB 1510: REM SET DATE
190 GOSUB 1300
192 GOSUB 1410: REM INPUT ANYTHING ROUTINE
195 TEXT
200 HOME : VTAB 6: PRINT "***************************************": VTAB 8: PRINT TAB( 10)"FILE CABINET STUFFER"
210 VTAB 10: PRINT TAB( 14)"MIKE KRAMER": PRINT TAB( 10)"2218 RUNNING SPRINGS": PRINT TAB( 10)"KINGWOOD,TEXAS 77339"
215 PRINT TAB( 5)"PRODOS VERSION BY MICHAEL MOORE"
220 VTAB 14: PRINT "***************************************"
230 VTAB 21: PRINT "INSERT FILE CABINET DISK AND PRESS ANY KEY:";
240 GET A$
260 REM ** READ BASENAMES **
270 ONERR GOTO 1250
280 PRINT D$"VERIFY";PX$ +"BASENAMES"
285 POKE 216,0
290 PRINT D$;"OPEN";PX$ +"BASENAMES"
300 PRINT D$;"READ";PX$ +"BASENAMES"
310 CALL 768,ND$:ND = VAL(ND$)
320 FOR N = 1 TO ND
330 CALL 768,FD$(N)
340 NEXT N
350 PRINT D$;"CLOSE"
360 ONERR GOTO 1270
370 REM ** DATA BASE MENU
380 TI$ = "FILE CABINET DATA CHANGE"
390 HOME : PRINT : PRINT TAB( 20 - LEN(TI$)/2)TI$: PRINT
400 PRINT "SELECT A DATABASE:"
410 FOR N = 1 TO ND
420 PRINT TAB( 5)"(";N;") ";FD$(N)
430 NEXT N
440 REM ** SELECT DATA BASE
450 PRINT : PRINT : INPUT "ENTER NUMBER OR '/' TO END: ";NU$:NU = VAL(NU$)
460 IF LEFT$(NU$,1) = "/" GOTO 1230
470 IF NU <1 OR NU >ND GOTO 450
480 REM ** READ HEADER FILE
490 Q$ = PX$ +FD$(NU) +"/" +"HEADER"
495 PRINT D$"VERIFY";Q$
498 POKE 216,0
500 PRINT D$;"OPEN";Q$
510 PRINT D$;"READ";Q$
520 CALL 768,NH$:NH = VAL(NH$)
530 FOR N = 1 TO NH
540 CALL 768,H$(N)
550 NEXT N
560 PRINT D$;"CLOSE"
570 GOSUB 580
580 POKE 34,0: HOME : VTAB 12: PRINT "READING ";FD$(NU);" DATA"
590 REM ** READ IN DATA
600 Q$ = PX$ +FD$(NU) +"/" +"INDEX"
610 PRINT D$;"OPEN";Q$
620 PRINT D$;"READ";Q$
630 CALL 768,NR$:NR = VAL(NR$)
640 FOR M = 1 TO NR
650 FOR N = 1 TO NH
660 CALL 768,IP$(M,N)
670 NEXT N
680 NEXT M
690 PRINT D$;"CLOSE"
700 REM ** SELECT HEADER TO CHANGE
710 HOME : VTAB 2: PRINT FD$(NU);" DATA HEADERS:"
720 PRINT TAB( 5)"(0) RECORD #"
730 FOR N = 1 TO NH
740 PRINT TAB( 5)"(";N;") ";H$(N)
750 NEXT N
760 POKE 34,NH +2
770 INPUT "LIST BY ITEM NUMBER: ";IT$:IT = VAL(IT$): IF IT <0 OR IT >NH GOTO 770
780 PRINT : INPUT "HOW MANY ITEMS TO CHANGE? ";NI$:NI = VAL(NI$)
790 IF LEFT$(NI$,1) = "A" OR NI = NH THEN NI = NH: FOR N = 1 TO NH:IT(N) = N: NEXT N: GOTO 850
800 IF NI <1 OR NI >NH GOTO 780
810 FOR N = 1 TO NI
820 PRINT : PRINT "NUMBER OF ITEM ";N;: INPUT ": ";IT$:IT(N) = VAL(IT$): IF IT(N) <1 OR IT(N) >NH THEN PRINT : PRINT "INVALID NUMBER.": GOTO 820
830 NEXT N
840 REM ** ENTER OR CHANGE DATA
850 POKE 34,0: HOME : PRINT TAB( 20 - LEN(FD$(NU))/2)DB$(NU): PRINT
860 PRINT "TYPE <RETURN> FOR NO CHANGE,<*>TO ABORT, <CTRL E> TO ERASE OLD ENTRY": POKE 34,5
870 FOR M = 1 TO NR
880 PRINT : PRINT "REC #";M
890 IF IT = 0 GOTO 910
900 PRINT : PRINT "ITEM #";IT;" = ";IP$(M,IT)
910 FOR K = 1 TO NI
920 PRINT H$(IT(K));" = ";IP$(M,IT(K))
930 INPUT "CHANGE TO: ";CH$
940 IF LEFT$(CH$,1) = "*" GOTO 1000
950 IF LEN(CH$) = 0 THEN PRINT : PRINT "NO CHANGE MADE.": PRINT : GOTO 980
960 IF CH$ = CHR$(5) THEN IP$(M,IT(K)) = "": PRINT : PRINT "ENTRY ERASED": PRINT : GOTO 980
970 IP$(M,IT(K)) = CH$: PRINT : PRINT "CHANGED TO ";IP$(M,IT(K)): PRINT
980 NEXT K
990 NEXT M
1000 VTAB 20: PRINT : INPUT "UPDATE DISK FILE? ";YN$: POKE 34,0
1010 IF LEFT$(YN$,1) = "Y" GOTO 1040
1020 IF LEFT$(YN$,1) = "N" GOTO 1160
1030 GOTO 1000
1040 POKE 34,0
1050 REM ** UPDATE DISK FILE
1060 Q$ = PX$ +FD$(NU) +"/" +"INDEX"
1070 PRINT D$;"OPEN";Q$
1080 PRINT D$;"WRITE";Q$
1090 PRINT NR$
1100 FOR M = 1 TO NR
1110 FOR N = 1 TO NH
1120 PRINT IP$(M,N)
1130 NEXT N
1140 NEXT M
1150 PRINT D$;"CLOSE"
1160 PRINT : INPUT "MORE CHANGES? ";A$
1170 IF LEFT$(A$,1) = "N" GOTO 1230
1180 IF LEFT$(A$,1) < >"Y" GOTO 1160
1190 PRINT : INPUT "USE SAME FILES (Y/N) ? ";A$
1200 IF LEFT$(A$,1) = "N" GOTO 380
1210 IF LEFT$(A$,1) = "Y" GOTO 710
1220 GOTO 1190
1230 POKE 34,0: HOME : END
1240 REM ** APPLESOFT ONERR CORRECTION
1250 CALL 1013:I = PEEK(222): POKE 216,0: IF I = 5 OR I = 6 THEN VTAB 18: PRINT "FILE CABINET FILES NOT ON THIS DISKETTE.": GOTO 230
1260 GOTO 1280
1270 CALL 1013
1280 HOME : VTAB 12: GOSUB 1340: IF I >3 AND I <10 THEN PRINT TAB( 3)"CORRECT ERROR, THEN PRESS A KEY.";: GET A$: PRINT : RESUME
1290 PRINT TAB( 7)"FATAL ERROR IN LINE "; PEEK(218) +256 * PEEK(219): VTAB 23: END
1300 FOR I = 1013 TO 1022: READ PP: POKE I,PP: NEXT I
1310 I = 0
1320 RETURN
1330 DATA 104,168,104,166,223,154,72,152,72,96
1340 MSG$ = CHR$(0):I = PEEK(222): POKE 216,0:: IF I = 0 OR I >15 THEN J = 53856 +I +(I = 255) * -1: GOTO 1360
1350 J = 43377 + PEEK(43583 +I)
1360 K = PEEK(J):MSG$ = MSG$ + CHR$(K): IF K <192 THEN J = J +1: GOTO 1360
1370 PRINT TAB( 20 - LEN("** " +MSG$ +" **")/2)"** ";MSG$;" **": PRINT : RETURN
1380 REM ERROR MESSAGE PRINTING (CALL APPLE 9/80)
1400 REM << INPUT ANYTHING >>
1410 FOR I = 1 TO 71: READ I%: POKE 768 +I -1,I%: NEXT I: RESTORE : RETURN
1420 DATA 32,190,222,32,227,223,36,17,208,5,162,0,76,15,3,133,133,132,134,165
1430 DATA 184,164,185,133,135,132,136,32,44,213,173,0,2,201,3,208,3,76,99,216
1440 DATA 169,0,133,13,133,14,169,0,160,2,32,237,227,32,61,231,32,123,218,165
1450 DATA 135,164,136,133,184,132,185,32,183,0,96,0,0,0,0,0,0,0,0,0
1500 REM << SET PRODOS DATE >>
1510 TEXT : HOME
1520 VTAB 5: HTAB 8: INVERSE : PRINT "FILE CABINET - STUFFER"
1530 PRINT : HTAB 12: PRINT "PRODOS VERSION"
1540 PRINT : HTAB 11: PRINT "BY MICHAEL MOORE"
1550 HTAB 14: PRINT "JUNE 1984": NORMAL
1560 DD = PEEK(49040) - INT( PEEK(49040)/32) *32
1570 IF DD < >0 THEN RETURN : REM SKIP DATE SET IF NOT NEEDED
1580 VTAB 13: CALL -958: REM CLEAR TO BOTTOM
1590 PRINT " DATE INPUT ROUTINE": PRINT
1600 VTAB 15: CALL -868
1610 INPUT "ENTER NUMBER OF CURRENT MONTH : ";MM
1620 IF MM <0 OR MM >12 GOTO 1600
1630 VTAB 16: CALL -868
1640 INPUT "ENTER NUMBER OF CURRENT DAY : ";DD
1650 IF DD <0 OR DD >31 GOTO 1630
1660 VTAB 17: CALL -868
1670 INPUT "ENTER LAST TWO DIGITS OF THE YEAR : ";YY
1680 IF YY <0 OR YY >99 GOTO 1660
1690 POKE 49041,YY *2 +(MM >7)
1700 IF MM >7 THEN POKE 49040,(MM -8) *32 +DD
1710 IF MM <8 THEN POKE 49040,MM *32 +DD
1720 RETURN